#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2025/1/20 15:00
# @Author : ZhengQL

from playwright.sync_api import sync_playwright

class AddProject:

    def __init__(self, page):
        self.page = page
        self.locator_project_name = page.get_by_placeholder("请输入项目名称")
        self.locator_project_app = page.get_by_placeholder("请输入发布应用")
        self.locator_project_desc = page.get_by_placeholder("请输入项目描述")
        self.locator_click_add = page.locator("text=点击提交")

        # 项目名称输入提示框



        # 发布应用输入提示看



        # 项目描述输入提示框



    # 封装页面操作方法
    def navigate(self):
        self.page.goto('http://47.116.12.183/add_project.html')

    def fill_project_name(self, project_name):
        self.locator_project_name.fill(project_name)
    def fill_project_app(self, project_app):
        self.locator_project_app.fill(project_app)

    def fill_project_desc(self, project_desc):
        self.locator_project_desc.fill(project_desc)

    def click_project_click(self):
        self.locator_click_add.click()

    def add_project(self, project_name, project_app, project_desc):
        self.fill_project_name(project_name)
        self.fill_project_app(project_app)
        self.fill_project_desc(project_desc)
        self.click_project_click()